 package org.edu.modules.pub.controller;

 import com.github.xiaoymin.knife4j.annotations.ApiSort;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.edu.common.api.vo.Result;
 import org.edu.common.aspect.annotation.AutoLog;
 import org.edu.common.system.base.controller.BaseController;
 import org.edu.modules.pub.entity.VeFileFiles;
 import org.edu.modules.pub.service.IVeFileFilesService;
 import org.edu.modules.pub.vo.VeFileFilesVO;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;























 @Api(tags = {"文件服务"})
 @RestController
 @RequestMapping({"/pub/veFileFiles"})
 @ApiSort(0)
 public class VeFileFilesController
   extends BaseController<VeFileFiles, IVeFileFilesService>
 {
/* 51 */   private static final Logger log = LoggerFactory.getLogger(org.edu.modules.pub.controller.VeFileFilesController.class);



   @Autowired
   private IVeFileFilesService veFileFilesService;



   @Value("${edu.path.urlPre}")
   private String fileUrlPre;



   @AutoLog("文件服务-查询文件")
   @ApiOperation(value = "查询files表", notes = "文件服务-查询文件")
   @PostMapping({"/queryById"})
   public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
     VeFileFiles veFileFiles = (VeFileFiles)this.veFileFilesService.getById(id);
/* 70 */     if (veFileFiles == null) {
/* 71 */       return Result.error("未找到对应数据");
     }
     VeFileFilesVO veFileFilesVO = new VeFileFilesVO();
/* 74 */     BeanUtils.copyProperties(veFileFiles, veFileFilesVO);
/* 75 */     veFileFilesVO.setSourcefile(this.fileUrlPre + veFileFiles.getSourcefile());
/* 76 */     veFileFilesVO.setDownloadurl(this.fileUrlPre + "pub/file/download/" + veFileFiles.getSourcefile());
     return Result.OK(veFileFilesVO);
   }
 }


